package com.example.orderminiappapi.service.Impl;

import com.example.orderminiappapi.bean.AddOrUpdate;
import com.example.orderminiappapi.bean.User;
import com.example.orderminiappapi.dao.UserAddressDao;
import com.example.orderminiappapi.service.UserAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UsersAddressServiceImpl implements UserAddressService {

    @Autowired
    private UserAddressDao userAddressDao;

    @Override
    public List<String> findAllUsersAddress(User user) {
        return userAddressDao.findAllUsersAddress(user);
    }

    @Override
    public int addAddress(AddOrUpdate addOrUpdate) {
        return userAddressDao.addAddress(addOrUpdate);
    }

    @Override
    public int updateAddress(AddOrUpdate addOrUpdate) {
        return userAddressDao.updateAddress(addOrUpdate);
    }

    @Override
    public int deleteAddress(AddOrUpdate addOrUpdate) {
        return userAddressDao.deleteAddress(addOrUpdate);
    }

    @Override
    public int changeCommonAddress1(AddOrUpdate addOrUpdate) {
        return userAddressDao.changeCommonAddress1(addOrUpdate);
    }

    @Override
    public int changeCommonAddress2(AddOrUpdate addOrUpdate) {
        return userAddressDao.changeCommonAddress2(addOrUpdate);
    }
}
